import 'package:flutter/material.dart';

class MyApp5 extends StatelessWidget {
  const MyApp5({super.key});

  @override
  Widget build(BuildContext context) {
    final screen = MediaQuery.of(context).size;
    return Scaffold(
        // 导航条
        appBar: AppBar(
          title: const Text('Container组件',
              style: TextStyle(color: Colors.white, fontSize: 20)),
          backgroundColor: Colors.pink,
          centerTitle: true,
        ),
        // 主体区域
        body: Center(
            child: Container(
                width: 300,
                height: screen.height / 3,
                // color: Colors.green,
                decoration: BoxDecoration(
                    // 背景颜色
                    color: Colors.green,
                    // 圆角
                    // borderRadius: BorderRadius.circular(10)
                    borderRadius:
                        const BorderRadius.only(topLeft: Radius.circular(20)),
                    // 边框
                    // border:Border(top: BorderSide(color: Colors.red, width: 5))
                    border: Border.all(color: Colors.teal, width: 10)),
                child: Container(
                  // 设置内容的对齐方式
                  alignment: Alignment.center,
                  margin: const EdgeInsets.all(20),
                  // margin: const EdgeInsets.only(top: 20, left: 40),
                  padding: const EdgeInsets.all(20),
                  color: Colors.yellow,
                  child: const Text('我是一个Container'),
                ))));
  }
}
